package com.example.ldachu.testdownload.http;

import com.example.ldachu.testdownload.http.base.BaseResponse;
import com.example.ldachu.testdownload.http.bean.IpAddressResponse;
import com.example.ldachu.testdownload.http.bean.VerifyAppVersion;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * @author zxKueen on 2017-12-22 9:04
 *         Email: 4994766@qq.com
 */

public interface DownloadService {
    /**
     * 请求的参数key
     */
    String KEY_PARAMS = "keyJson";


    /**
     *
     * 检查接口更新
     * @return
     */
    @FormUrlEncoded
    @POST("/api/Passport/VerifyAppVersion")
    Observable<BaseResponse<VerifyAppVersion>> getVerifyAppVersion(@Field(KEY_PARAMS) String keyValue);

    @GET
    Observable<ResponseBody> downloadPic(@Url String imgUrl);


    @GET
    Observable<IpAddressResponse> getIP(@Url String imgUrl);

    @Streaming
    @GET
    Observable<ResponseBody> download(@Url String imgUrl);

}
